//package com.oauth.oauth.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//
//@Configuration
//
//public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
//
//    @Bean
//    public ResourceServerTokenServices resourceServerTokenServices(){
//        CustomRemoteTokenServices remoteTokenServices = new CustomRemoteTokenServices(
//                "http://192.168.0.11:48080/admin-api/aus/oauth2/check-token",
//                "6e0e4d3388954d77b7fe666168683dc8",
//                "609af22212af417d9f71812f017def36"
//        );
////        RemoteTokenServices remoteTokenServices = new RemoteTokenServices();
////        remoteTokenServices.setCheckTokenEndpointUrl("http://192.168.0.11:48080/admin-api/aus/oauth2/check-token");
////        remoteTokenServices.setClientId("6e0e4d3388954d77b7fe666168683dc8");
////        remoteTokenServices.setClientSecret("609af22212af417d9f71812f017def36");
////        remoteTokenServices.setTokenName("token");
//        return remoteTokenServices;
//    }
//    @Override
//    public void configure(HttpSecurity http) throws Exception {
//        http.authorizeRequests()
//                .antMatchers("/whitelist/**", "/public/**").permitAll()
//                .antMatchers("/api/user/**").hasAuthority("ROLE_USER") // 例如，特定路径需要特定角色
//                .anyRequest().authenticated();
//    }
//
////    @Override
////    public void configure(ResourceServerSecurityConfigurer resources) {
////        resources.tokenServices(new CustomRemoteTokenServices(
////                "http://192.168.3.22:48085/admin-api/aus/oauth2/check-token",
////                "6e0e4d3388954d77b7fe666168683dc8",
////                "609af22212af417d9f71812f017def36"
////        ));
////    }
//
//}
